$(function () {
    $("#jqGrid").jqGrid({
        url: baseURL + 'exam/middle/list',
        datatype: "json",
        colModel: [
			{ label: '日期', name: 'examDate', width: 80, sortable: false, formatter:'date',formatoptions:{newformat:'Y-m-d'}},
			{ label: '编号', name: 'studentCode', width: 80, sortable: false},
			{ label: '姓名', name: 'name', width: 80, sortable: false },
			{ label: '总圈', name: 'totalCircle', width: 80 , sortable: false},
			{ label: '已跑圈数', name: 'circle', width: 80, sortable: false },
			{ label: '中长跑(分.秒)', name: 'middleRun', width: 80, sortable: false },
			{ label: '成绩', name: 'middleRunScore', width: 80, sortable: false }
		],
		viewrecords: true,
        height: 385,
        rowNum: 10,
		rowList : [10,30,50],
        rownumbers: true,
        rownumWidth: 25,
		shrinkToFit:false,
        autowidth:true,
        multiselect: true,
        pager: "#jqGridPager",
        jsonReader : {
            root: "page.list",
            page: "page.currPage",
            total: "page.totalPage",
            records: "page.totalCount"
        },
        prmNames : {
            page:"page",
            rows:"limit"
        }
        // ,
        // gridComplete:function(){
        // 	//隐藏grid底部滚动条
        // 	$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
        // }
    });

});

var vm = new Vue({
	el:'#rrapp',
	data:{
		examDate:"",
        q:{
            name: null,
			studentCode: null,
			examDate: null
        },
		showList: true,
		title: null
	},
	methods: {
		query: function () {

			vm.reload();
		},
		reload: function (event) {
			vm.showList = true;
			var page = $("#jqGrid").jqGrid('getGridParam','page');
			$("#jqGrid").jqGrid('setGridParam',{
                postData:{'name': vm.q.name, 'studentCode': vm.q.studentCode, 'examDate': vm.examDate},
                page:page
            }).trigger("reloadGrid");
		}
	}
});

// $('.examDateCss').datepicker({
// 	language: 'zh-CN',
// 	format: 'yyyy-mm-dd'
// }).on('hide', function(e) {
// 	console.log(e)
// });



